local yunfenglei = fk.CreateSkill{
  name = "lzsj__yunfenglei",
}

Fk:loadTranslationTable{
  ["lzsj__yunfenglei"] = "蕴风雷",
  [":lzsj__yunfenglei"] = "回合技，当一名角色于你回合内失去最后的手牌后，其可视为使用【顺手牵羊】。",
  ["#lzsj__yunfenglei-use"] = "你可视为使用【顺手牵羊】",

  ["$lzsj__yunfenglei1"] = "奉天兵工厂冒烟，小日本以为咱是造锄头？",
  ["$lzsj__yunfenglei2"] = "小六子勾搭南边？老子能捧他也能废他！",
}

yunfenglei:addEffect(fk.AfterCardsMove, {
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
   if player:hasSkill(yunfenglei.name) and player.room.current == player then
      for _, move in ipairs(data) do
        if player:usedSkillTimes(yunfenglei.name) == 0 then
          for _, info in ipairs(move.moveInfo) do
            if info.fromArea == Card.PlayerHand then
              return move.from:isKongcheng()
            end
          end
        end
      end
    end
  end,
  on_cost = function (self, event, target, player, data)
    local room = player.room
    for _, move in ipairs(data) do
      local use = room:askToUseVirtualCard(move.from, {
        name = "snatch",
        skill_name = yunfenglei.name,
        prompt = "#lzsj__yunfenglei-use",
        cancelable = true,
        skip = true,
      })
      if use then
        event:setCostData(self, {use = use})
        return true
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    local use = event:getCostData(self).use
    player.room:useCard(use)
  end,
})

return yunfenglei